// app/models/user.js
// load the things we need
var mongoose = require('mongoose');

// define the schema for our user model
var userSchema = new mongoose.Schema({

	openid : String,
	cellphone : String,
	gender : Number,
	city : String,
	province : String,
	country : String,
	avatar : String,
	nickName : String,
	usertype : String,
	date : Date,
	name : String,
	unionID :String,
	viewCount : Number,
	uniqueViewCount : Number,
	shareCount : Number,
	uniqueShareCount : Number,
	cellphoneVerified : Number,
	tags : []

	});											

// methods ======================
userSchema.index({openid: 1});
userSchema.index({date: 1});
userSchema.index({cellphone: 1});
// create the model for users and expose it to our app
module.exports = mongoose.model('User', userSchema);
